/*-------------------------------------------------------------------------

   File:		vssizes.h
   Project:		VeriFone SoftPay Base
   Description:	Header File for all C files

***************** Modification History ***********************************

$Log: /SoftPay/SPK2SIM/Source/Include/sizes.h $

**************************************************************************

   Copyright (C) 1999 by VeriFone, Inc.

   All rights reserved.  No part of this software may be reproduced,
   transmitted, transcribed, stored in a retrieval system, or translated
   into any language or computer language, in any form or by any means,
   electronic, mechanical, magnetic, optical, chemical, manual or otherwise,
   without the prior written permission of VeriFone, Inc.

---------------------------------------------------------------------------*/


#ifndef VSSIZES_DEFINED
#define VSSIZES_DEFINED


/************************ Common Field Sizes definitions *******************/
#define CHOLDER_SIZE          30            /* Card holder name to print    */
#define CLABEL_SIZE           20            /* Card name */
#define DATE_SIZE              6            /* Date in MMDDYY format        */
#define TIME_SIZE              6            /* Time in HHMMSS format        */
#define COMPLETE_DATE_AND_TIME_SIZE 15      /* as required in yyyymoddhhmissw */
#define CENTURY_SIZE           2            /* as in 20th or 19th */
#define PAN_SIZE              19            /* Primary account number       */
#define EXP_DATE_SIZE          4            /* Expiry date MMYY             */
#define AMT_SIZE              18            /* Maximum amount size          */
#define NII_SIZE               3            /* Network Intl Id              */
#define HHMM_SIZE              4            /* Time to minute size */
#define SETTLE_RESP_SIZE      30            /* Settlement Response size     */
#define STATE_CODE_SIZE        2            /* Check Tran. State Code Size  */
#define ZIP_CODE_SIZE          9            /* Check Tran. Zip Code Size    */
#define CHECK_NUMBER_SIZE     12            /* Check Number Size            */
#define CHECK_ACCT_NUM_SIZE   15            /* Checking Account Number Size */
#define MANUAL_DLN_SIZE       38            /* Manual Drivers Lic. Size     */
#define MANUAL_MICR_SIZE      26            /* Manual MICR Number Size      */
#define MICR_SIZE             50            /* MICR Number Swipe Size       */

#define PIN_SIZE              16            /* Size of PIN data             */
#define KSN_SIZE              20            /* DUKPT Key Serial Number      */
#define ACCT_TYPE_SIZE         1            /* Default account type */
#define TERM_ID_SIZE          16            /* Terminal Identifier          */
#define MERCH_ID_SIZE         22            /* Merchant Identifier :Old 15  */
#define TRACK1_SIZE           79            /* Size of track one data       */
#define TRACK2_SIZE           38            /* Size of track two data       */
#define TRACK3_SIZE          150            /* Size of track three data     */
#define SVC_CODE_SIZE          4            /* Size of service code */
#define LOGON_TYPE_SIZE        1            /* Size of logon type           */
#define ECR_INVNUM_SIZE       11            /* Size of ECR invoice number   */
#define INSTALLMENTS_SIZE      3            /* Size of # of installments    */
#define INST_FLAG_SIZE         1            /* Size of installments flag    */
#define ORIG_TRANS_DATE_SIZE   8            /* Size of orig trans date		*/

#define MAX_TRACK1_NAME_SIZE  26            /* Max card holder name size    */
#define TRACKS_ALLOWED         3

#define DATA_BLOCK_SIZE        8            /* Block size for MAC computatn */

#define DEV_SIZE               2
#define TRNO_SIZE              2
#define EMP_SIZE               6
#define RESP_SIZE              3
#define MEMB_SIZE              3
#define DATA_SIZE             14
#define AUTH_SIZE              6
#define SEQ_SIZE              10
#define ID_SIZE               10            /* Application Id size          */
#define DWNLD_KEY_SIZE        14            /* DownLoad Key Size            */

#define APP_SIZE               8
#define KEY_SIZE              16

#define HOST_INDEX_SIZE        2            /* Size of Host index number    */

#define FIVE_DIGIT_ACCT        5            /* 5 Digits of Acct Num         */
#define LAST4_DIGIT_ACCT       4            /* LAST 4 Digits of Acct Num    */

#define MESSAGE_FILE_NAME_SIZE 3

#define TRAN_TYPE_MSG_SIZE   16           /* Transaction type msg size */

#define TRANS_ID_SIZE         15        /* Transaction Identifier       */
#define VALID_CODE_SIZE        4        /* Validation Code              */
#define ISSUER_NUM_SIZE		   2

/********** Following per removal of visa-specific items from base app. **********/
#define HF_BRSP_CODE_SIZE      2   /* Batch response code size: primary host uses         */
#define HF_BRSP_MSG_SIZE      30   /* Batch response message size: primary host uses      */
/********** Preceding per removal of visa-specific items from base app. **********/

/*************************** Common definitions ****************************/
                                                                                       /* Offset due to GENDATA version*/
#define AMT_STR_SIZE           9           /* 8 numeric chars and a '.'     */
#define GEN_VER_SIZE          16           /* information in config files   */
#define NAME_SIZE             20           /* Transaction Name/Modifier size */
#define INT_STR_SIZE           5           /* Max int val-32767, so 5 char  */
#define LONG_STR_SIZE         10           /* Max long val- 2147483674, 15  */

#define ENV_VAR_SIZE          30           /* Size of the environment var   */
#define ENV_BUF_SIZE          50           /* Size of the environment buffer*/


#define SAFE_SIZE              4           /* Safe size for batch full check*/
#define SETTLE_SOON_SIZE      24           /* No of txns left for Settle Soon msg */

#define DLL_BUF_SIZE         250           /* Max Size of DLL Response Packet */
#define DISP_STR_LEN          26           /* String disp'd on terminal  */
#define FILENAME_SIZE         14           /* 2 char drive, 8 char name, a '.' & 3 char extension */
#define MSG_FILE_PREFIX_SIZE   4           /* as in ENGLxxxx.dat */
#define TPL_FILE_SUFFIX_SIZE   4
#define CARD_TYPE_SIZE         1

#define MESSAGE_SIZE          29

#define DIGITSINAMOUNT         8
#define MAX_DECIMAL_DIGITS     2

#define SHIFT_ARRAY_SIZE      10

/** File name drive **/
#define STATIC_DATA_PATH        "F:"


/******************** Printer specific definitions **************************/
#define FORMATTED_AMOUNT_SIZE    20             /* final amt size now 20, not 10 + 3 + 1*/
#define FORMATTED_DATE_SIZE       12             /* Date in MM/DD/YY format  plus some additional spaces */
#define FORMATTED_EXP_DATE_SIZE   5             /* Date in MM/YY format     */
#define FORMATTED_PAN_SIZE       41             /* final pan size */
#define FORMATTED_TIME_SIZE       8             /* Time in HH:MM:SS         */
#define RECEIPT_HEADER_SIZE      40             /* Max. header size         */
#define SML_CLABEL_SIZE           2             /* Card label for detail rpt*/
#define SML_ACCT_SIZE             7             /* abbr acct number -det rpt*/
#define TRAN_STATUS_SIZE          3             /* transaction status code */
#define AVS_CODE_SIZE			  2				/* Size of AVS code        */

/*********************** CCT related length variables ***********************/
#define COM_PORT_SIZE               1           /* check reader port size */

/*********************** CDT related length variables ***********************/

#define CDT_CRANGE_SIZE          19          /* Size of card range number   */

#define MAX_CONFIG_FIELD_SIZE    64        /* Max Size for field node fields */

/*********************** CRT related length variables ***********************/
#define CRT_APPL_ID_SIZE            7           /* Cr600 application id size */
#define CRT_TERM_ID_SIZE            10          /* Cr600 terminal id size */
#define CRT_OUT_FMT_SIZE            3           /* Cr600 output format size */


/*********************** HDT related length variables ***********************/

#define HOST_NAME_SIZE    10              /* Name for printing and display  */
#define PHONE_NUM_SIZE    30              /* All phone number's size        */

#define BATCH_NUM_SIZE     6              /* current largest batch number possible          */

#define INV_NUM_SIZE      10              /* current invoice number         */
#define CUR_SYMBOL_SIZE    3              /* USD for $, PND for Pound       */
#define CUR_CODE_SIZE      4
#define SHIFT_NUM_SIZE     3              /* Shift number size              */
#define SEQ_NUM_SIZE       4              /* Size of Sequence number        */

#define ZIPCODE_SIZE       9              /* Zip Code size                  */
#define ADDRESS_SIZE      19              /* Street address size            */
#define CVV2_SIZE          4              /* CVV2 value size */
#define FILE_SUFFIX_SIZE  4				  /* Host data file name size */

/*********************** TRT related length variables ***********************/
#define TRT_ABBREV_SIZE    2              /* Name Abbreviation for printing and display  */

/********************* LCT related length variables *************************/

#define LCT_LANGUAGE_NAME_SIZE      20
#define LANG_NAME_FONT_BYTES_SIZE   16  /* 4 bytes for FontType=0, 8 for FontType=1, 16 for FontType=2 */

/********************* CPT related length variables *************************/

#define TPDU_SIZE         11              /* Trnsprt protocol data unit     */
#define MODEM_PARAM_SIZE  50              /* Terminal modem parameters      */
#define CONNEXANT_MODEM_PARAM_SIZE	128	/* Connexant Modem needs bigger buffer */
#define PABX_CODE_SIZE     4              /* AlphaNum digits before dial    */

/********************* PDT related length variables *************************/
#define PDT_DESC_SIZE     18              /* Product Description Size       */
#define PDT_PROD_CODE_SIZE 2              /* Product Code Size */
#define PDT_AMT_SIZE       7              /* Product Amount Size */


/********************** TCT related length variables ************************/

#define TERM_ADDR_SIZE   40               /* Address - city, state etc      */
#define PASSWORD_SIZE     6               /* All password sizes             */
#define IDLE_TO_SIZE      3               /* Idle timeout in seconds */
#define DATE_FORMAT_SIZE  12			  /* Date format size */

/******************** UDT related length informations **********************/

#define CLERK_ID_SIZE          4                /* Clerk Id - 2 character long     */
#define DWNLD_GEN_BUF_SIZE   550             /* Recieve/Transmit buffer size     */
#define GEN_BUF_SIZE         512               /* Recieve/Transmit buffer size     */

/******************** Loyalty Specific Sizes ***********************************/
#define POINT_CTR_SIZE        4

#define TRAN_CODE_SIZE            2              /* Transaction codes 00, 50 .. etc */
#define MERCH_INDEX_SIZE          2              /* Size of Merchant Index Number */



/* Total customer data includes one of these combinations.
 *
 *     . Track 1 or 2, FS, Cardholder Id data, FS, Trans Amount, FS
 *     . PAN, FS, Expiry date, FS, Cardholder Id data, FS, Trans Amount, FS
 */


/*************************** ISO specific ***********************************/
#define ISO_AMT_SIZE              12       /* Maximum amount size for ISO  */
#define ISO_BATCH_NUM_SIZE        6        /* Max Batch number size        */
#define MTI_SIZE                  2
#define PROC_CODE_SIZE            3        /* Processing Code size         */
#define PROD_CODE_SIZE            2        /* Product code buffer size     */
#define PROD_DESC_SIZE            15       /* Product description size     */
#define PROD_POINTS_SIZE          7        /* Product points size          */
#define PROD_TOT_POINTS_SIZE      8        /* Product total points size    */
#define MAX_PROD_CODES            4
#define STAN_SIZE                 6        /* System trace number size     */
#define POS_CON_SIZE              2        /* POS Condition Code size      */
#define POS_EM_SIZE               3        /* POS Entry Mode size          */
#define RET_REF_SIZE              12       /* Retrieval reference num size */
#define SETT_DATE_SIZE            4        /* Settlement Date size         */
#define REF_CUST_SIZE             17       /* Ret reference/Cust num size */
#define ISO8583FLD_SIZE			  256      /* size for src and dst buffers */

#define AUTH_CODE_SIZE            6        /* Authorization code size      */
#define ROOM_NUM_SIZE             5        /* Room Number size             */

#define RESP_CODE_SIZE            3        /* Response code size           */
#define RESP_MSG_SIZE            40        /* Auth response message  mb1   */
#define TID_SIZE                  8        /* Terminal Identification size */
#define ADD_RESP_SIZE            25        /* Additional Response data     */
#define PVT_60_SIZE              30        /* Maxium size of pvt field 60  */
#define PVT_61_SIZE               8        /* Maxium size of pvt field 61  */
#define PVT_62_SIZE               6        /* Maxium size of pvt field 62  */
#define PVT_63_SIZE              40        /* Maxium size of pvt field 63  */

#define TRANS_TITLE_SIZE         20        /* PIT trans title size */

/* dota_license - equipment */
#define KEY_LICENSE_SIZE			16		/* License key size */

/*************************** ProtoBase specific ***********************************/

#define PS_2K_SIZE               23        /* PS2K data */
#define HOST_REF_SIZE             8        /* Host generated reference number */

/************* Peripheral Devices Sizes Definitions ***********************/

#define DEVICE_TYPE_SIZE        5
#define APPL_ID_SIZE                6
#define CONFIG_VERSION_SIZE    2


/****************** Pin Pad and Mac Specific Definitions ********************/
#define PIN_BLOCK_SIZE           16        /* Pin size */
#define SIMPLE_KEY_SIZE          16        /* Encryption key size (simple) */
#define MAC_SIZE                  8        /* Mesg Authentication Code     */
// Debit DUKPT
#define KSI_SIZE                  6        /* DUKPT Key Set Identifier size */

/***************  Device IOCTL Call Buffer Size Definition *****************/
#define IOCTRL_BUFFER_SIZE          4

/****************** Field Value Max Size in Config Tables ********************/
#define MAX_FIELD_SIZE          128
#define MAX_CONFIG_NM_SIZE      8           /* E.g., MENU01 */
#define MAX_ASSIST_CHUNK_SIZE   160

#define ISDN_ADDRESS_LENGTH     42          /* ISDN X.28 Signals Data Length */

/****************** Sizes for Datapac Communication ********************/

#define DP3101_HOST_ADDR_SIZE   12
#define POLL_ADDRESS_SIZE        4

/****************** Sizes for INTERAC ********************/

#define SERVICE_CODE_SIZE        3
#define ICPA_SN_SIZE             6            /* PP501 Serial Number Size     */

/******************* Sizes for Mobitex ******************/

#define MAN_LENGTH               6

#define	MAX_TRAN_FLEXI_REC_SIZE	 800

/******************** Fleet Card Specific Sizes ******************************/

#define FLEET_VEHICLE_NUM_SIZE  6
#define FLEET_DRIVER_NUM_SIZE   6
#define FLEET_ODOMETER_SIZE     6
#define FLEET_PRODUCT_CODE_SIZE 2
#define FLEET_QUANTITY_SIZE 	8
#define FLEET_DESC_SIZE         18

//kv1 debug - for MAX_MODEL_SIZE in UCLDEFINE
#define MAX_TERMINAL_NAME_SIZE  12

/******************* Include for custom sizes ******************/

/* path must be defined for use with data files and 'C' Files */


#endif  /* VSSIZES_DEFINED */

/* No custom sizes for this project */
/* Defines required by EMV */
#define TC_GEN1AC_APPROVE  "Y1"
#define AAC_GEN1AC_DECLINE  "Z1"
#define TC_GEN2AC_APPROVE  "Y3"
#define AAC_GEN2AC_DECLINE  "Z3"
#define EMV_CARD_REFERRAL_APPROVAL	"Y2"
#define EMV_CARD_REFERRAL_DECLINE		"Z2"

/* path must be defined for use with data files and 'C' Files */
//albert WiFi
#define SYS_MAX_SIZE       20
#define WKY_MAX_SIZE       20
#define IP_MAX_SIZE       25

#define CPAC_TERM_ID_SIZE        16 // @comm #define CPAC_TERM_ID_SIZE     -    16
#define CPAC_MERCH_ID_SIZE       16 // @comm #define CPAC_MERCH_ID_SIZE    -    16
#define CPAC_TPDU_SIZE           11 // @comm #define CPAC_TPDU_SIZE        -    11
#define CPAC_NII_SIZE             4 // @comm #define CPAC_NII_SIZE         -    3
#define CPAC_PVT_61_SIZE          8 // @comm #define CPAC_PVT_61_SIZE      -    8
#define CPAC_DATE_TIME_SIZE		 14 // @comm #define CPAC_DATE_TIME_SIZE   -    14	

